const app = getApp();
Page({
  data: {
    lessons: [],
  },
  onLoad() {
    let lessons = wx.getStorageSync("favorites");
    if (!lessons) return;
    this.setData({
      lessons: Object.values(lessons),
    });
  },
  watchLesson(event) {
    app.globalData.lessonId = event.mark.lesson._id;
    wx.switchTab({
      url: "/pages/lesson/lesson",
    });
  },
});
